
{% if  pillar['Internal_DNS'] == 'disable' %}

  {% set DNS1 = "223.5.5.5" %}
  {% set DNS2 = "8.8.8.8" %}

{% elif pillar['deploy_env'] == 'prod'  %}
  {% set DNS1 = pillar['prod_dns1'] %}
  {% set DNS2 = pillar['prod_dns2'] %}
{% else %}
  {% set DNS1 = pillar['dev_dns1'] %}
  {% set DNS2 = pillar['dev_dns2'] %}
{% endif %}


/etc/resolv.conf:
  file.managed:
    - source: salt://files/dns/resolv.conf
    - user: root
    - group: root
    - mode: 644
    - template: jinja
    - defaults:
      DNS_SERVER1: {{DNS1}}
      DNS_SERVER2: {{DNS2}}
